﻿using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace Model
{
    [MetadataType(typeof(Information_Content_Metadata))]
    [DisplayName("内容")]
    public partial class Information_Content
    {
        public Information_Content()
        {
            this.Id = Guid.NewGuid();
            this.AddDate = DateTime.Now;
            this.LastEditDate = DateTime.Now; 
        }

        public class Information_Content_Metadata
        {
            [ScaffoldColumn(false)]
            public System.Guid Id { get; set; }

            [DisplayName("主题")]
            [Required(ErrorMessage = "*")]
            public string Title { get; set; }

            [DisplayName("副主题")]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public string SubTitle { get; set; }

            [DisplayName("标题图片")]
            [DataType(DataType.ImageUrl)]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public string ImageUrl { get; set; }

            [DisplayName("外部链接")]
            [DataType(DataType.Url)]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public string LinkUrl { get; set; }

            [DisplayName("附件")]
            [UIHint("FileUrl")]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public string FileUrl { get; set; }

            [DisplayName("内容")]
            [Required(ErrorMessage = "*")]
            [DataType(DataType.MultilineText)]
            public string Content { get; set; }

            [DisplayName("作者")]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public string Author { get; set; }

            [DisplayName("来源")]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public string Source { get; set; }

            [DisplayName("简介")]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public string Summary { get; set; }

            [DisplayName("标签")]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public string Tags { get; set; }

            [DisplayName("发布日期")]
            [DataType(DataType.DateTime)]
            public DateTime AddDate { get; set; }

            [DisplayName("修改日期")]
            [DataType(DataType.DateTime)]
            public DateTime LastEditDate { get; set; }

            [DisplayName("推荐")]
            public bool IsRecommend { get; set; }

            [DisplayName("置顶")]
            public bool IsTop { get; set; }

            [HiddenInput]
            [DisplayName("用户")]
            public Guid UserId { get; set; }

            [DisplayName("点击")]
            public int Hits { get; set; }

            [DisplayName("作废")]
            public bool Deleted { get; set; }
        }
    }
}
